package com.shemy.service;

import com.shemy.dao.UserDao;
import com.shemy.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description
 * @Author Dzsom
 * @Date 2019-04-26 17:29
 * @Encoding UTF-8
 * @Version 1.0
 **/
@Service
public class UserServiceImpl implements UserService {

    private final UserDao userDao;

    @Autowired
    public UserServiceImpl(UserDao userDao) {
        this.userDao = userDao;
    }

    public void save(User user) {
        userDao.save(user);
    }

    public List<User> findAll() {
        return userDao.findAll();
    }

    public User findById(long id) {
        return userDao.findById(id);
    }

    public void delete(long id) {
        userDao.delete(id);
    }
}
